/**
 */
package ar.edu.unlp.mobilex.impl;

import ar.edu.unlp.mobilex.MobilexPackage;
import ar.edu.unlp.mobilex.Setting;
import ar.edu.unlp.mobilex.Style;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Setting</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getLanguage <em>Language</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getImage <em>Image</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#isNotification <em>Notification</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getSound <em>Sound</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#isFullScreenMode <em>Full Screen Mode</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getAbout <em>About</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getVersion <em>Version</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getLicencia <em>Licencia</em>}</li>
 *   <li>{@link ar.edu.unlp.mobilex.impl.SettingImpl#getStyle <em>Style</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SettingImpl extends EObjectImpl implements Setting {
	/**
	 * The default value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected static final Integer LANGUAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected Integer language = LANGUAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getImage() <em>Image</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getImage()
	 * @generated
	 * @ordered
	 */
	protected static final String IMAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getImage() <em>Image</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getImage()
	 * @generated
	 * @ordered
	 */
	protected String image = IMAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #isNotification() <em>Notification</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isNotification()
	 * @generated
	 * @ordered
	 */
	protected static final boolean NOTIFICATION_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isNotification() <em>Notification</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isNotification()
	 * @generated
	 * @ordered
	 */
	protected boolean notification = NOTIFICATION_EDEFAULT;

	/**
	 * The default value of the '{@link #getSound() <em>Sound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSound()
	 * @generated
	 * @ordered
	 */
	protected static final String SOUND_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSound() <em>Sound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSound()
	 * @generated
	 * @ordered
	 */
	protected String sound = SOUND_EDEFAULT;

	/**
	 * The default value of the '{@link #isFullScreenMode() <em>Full Screen Mode</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isFullScreenMode()
	 * @generated
	 * @ordered
	 */
	protected static final boolean FULL_SCREEN_MODE_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isFullScreenMode() <em>Full Screen Mode</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isFullScreenMode()
	 * @generated
	 * @ordered
	 */
	protected boolean fullScreenMode = FULL_SCREEN_MODE_EDEFAULT;

	/**
	 * The default value of the '{@link #getAbout() <em>About</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAbout()
	 * @generated
	 * @ordered
	 */
	protected static final String ABOUT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getAbout() <em>About</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAbout()
	 * @generated
	 * @ordered
	 */
	protected String about = ABOUT_EDEFAULT;

	/**
	 * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVersion()
	 * @generated
	 * @ordered
	 */
	protected static final Integer VERSION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVersion()
	 * @generated
	 * @ordered
	 */
	protected Integer version = VERSION_EDEFAULT;

	/**
	 * The default value of the '{@link #getLicencia() <em>Licencia</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLicencia()
	 * @generated
	 * @ordered
	 */
	protected static final String LICENCIA_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLicencia() <em>Licencia</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLicencia()
	 * @generated
	 * @ordered
	 */
	protected String licencia = LICENCIA_EDEFAULT;

	/**
	 * The cached value of the '{@link #getStyle() <em>Style</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStyle()
	 * @generated
	 * @ordered
	 */
	protected Style style;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SettingImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MobilexPackage.Literals.SETTING;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer getLanguage() {
		return language;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLanguage(Integer newLanguage) {
		Integer oldLanguage = language;
		language = newLanguage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__LANGUAGE, oldLanguage, language));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getImage() {
		return image;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setImage(String newImage) {
		String oldImage = image;
		image = newImage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__IMAGE, oldImage, image));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isNotification() {
		return notification;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNotification(boolean newNotification) {
		boolean oldNotification = notification;
		notification = newNotification;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__NOTIFICATION, oldNotification, notification));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSound() {
		return sound;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSound(String newSound) {
		String oldSound = sound;
		sound = newSound;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__SOUND, oldSound, sound));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isFullScreenMode() {
		return fullScreenMode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFullScreenMode(boolean newFullScreenMode) {
		boolean oldFullScreenMode = fullScreenMode;
		fullScreenMode = newFullScreenMode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__FULL_SCREEN_MODE, oldFullScreenMode, fullScreenMode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getAbout() {
		return about;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAbout(String newAbout) {
		String oldAbout = about;
		about = newAbout;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__ABOUT, oldAbout, about));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer getVersion() {
		return version;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVersion(Integer newVersion) {
		Integer oldVersion = version;
		version = newVersion;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__VERSION, oldVersion, version));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLicencia() {
		return licencia;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLicencia(String newLicencia) {
		String oldLicencia = licencia;
		licencia = newLicencia;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__LICENCIA, oldLicencia, licencia));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Style getStyle() {
		return style;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetStyle(Style newStyle, NotificationChain msgs) {
		Style oldStyle = style;
		style = newStyle;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__STYLE, oldStyle, newStyle);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStyle(Style newStyle) {
		if (newStyle != style) {
			NotificationChain msgs = null;
			if (style != null)
				msgs = ((InternalEObject)style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MobilexPackage.SETTING__STYLE, null, msgs);
			if (newStyle != null)
				msgs = ((InternalEObject)newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MobilexPackage.SETTING__STYLE, null, msgs);
			msgs = basicSetStyle(newStyle, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.SETTING__STYLE, newStyle, newStyle));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case MobilexPackage.SETTING__STYLE:
				return basicSetStyle(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MobilexPackage.SETTING__LANGUAGE:
				return getLanguage();
			case MobilexPackage.SETTING__IMAGE:
				return getImage();
			case MobilexPackage.SETTING__NOTIFICATION:
				return isNotification();
			case MobilexPackage.SETTING__SOUND:
				return getSound();
			case MobilexPackage.SETTING__FULL_SCREEN_MODE:
				return isFullScreenMode();
			case MobilexPackage.SETTING__ABOUT:
				return getAbout();
			case MobilexPackage.SETTING__VERSION:
				return getVersion();
			case MobilexPackage.SETTING__LICENCIA:
				return getLicencia();
			case MobilexPackage.SETTING__STYLE:
				return getStyle();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MobilexPackage.SETTING__LANGUAGE:
				setLanguage((Integer)newValue);
				return;
			case MobilexPackage.SETTING__IMAGE:
				setImage((String)newValue);
				return;
			case MobilexPackage.SETTING__NOTIFICATION:
				setNotification((Boolean)newValue);
				return;
			case MobilexPackage.SETTING__SOUND:
				setSound((String)newValue);
				return;
			case MobilexPackage.SETTING__FULL_SCREEN_MODE:
				setFullScreenMode((Boolean)newValue);
				return;
			case MobilexPackage.SETTING__ABOUT:
				setAbout((String)newValue);
				return;
			case MobilexPackage.SETTING__VERSION:
				setVersion((Integer)newValue);
				return;
			case MobilexPackage.SETTING__LICENCIA:
				setLicencia((String)newValue);
				return;
			case MobilexPackage.SETTING__STYLE:
				setStyle((Style)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MobilexPackage.SETTING__LANGUAGE:
				setLanguage(LANGUAGE_EDEFAULT);
				return;
			case MobilexPackage.SETTING__IMAGE:
				setImage(IMAGE_EDEFAULT);
				return;
			case MobilexPackage.SETTING__NOTIFICATION:
				setNotification(NOTIFICATION_EDEFAULT);
				return;
			case MobilexPackage.SETTING__SOUND:
				setSound(SOUND_EDEFAULT);
				return;
			case MobilexPackage.SETTING__FULL_SCREEN_MODE:
				setFullScreenMode(FULL_SCREEN_MODE_EDEFAULT);
				return;
			case MobilexPackage.SETTING__ABOUT:
				setAbout(ABOUT_EDEFAULT);
				return;
			case MobilexPackage.SETTING__VERSION:
				setVersion(VERSION_EDEFAULT);
				return;
			case MobilexPackage.SETTING__LICENCIA:
				setLicencia(LICENCIA_EDEFAULT);
				return;
			case MobilexPackage.SETTING__STYLE:
				setStyle((Style)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MobilexPackage.SETTING__LANGUAGE:
				return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language);
			case MobilexPackage.SETTING__IMAGE:
				return IMAGE_EDEFAULT == null ? image != null : !IMAGE_EDEFAULT.equals(image);
			case MobilexPackage.SETTING__NOTIFICATION:
				return notification != NOTIFICATION_EDEFAULT;
			case MobilexPackage.SETTING__SOUND:
				return SOUND_EDEFAULT == null ? sound != null : !SOUND_EDEFAULT.equals(sound);
			case MobilexPackage.SETTING__FULL_SCREEN_MODE:
				return fullScreenMode != FULL_SCREEN_MODE_EDEFAULT;
			case MobilexPackage.SETTING__ABOUT:
				return ABOUT_EDEFAULT == null ? about != null : !ABOUT_EDEFAULT.equals(about);
			case MobilexPackage.SETTING__VERSION:
				return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
			case MobilexPackage.SETTING__LICENCIA:
				return LICENCIA_EDEFAULT == null ? licencia != null : !LICENCIA_EDEFAULT.equals(licencia);
			case MobilexPackage.SETTING__STYLE:
				return style != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (language: ");
		result.append(language);
		result.append(", image: ");
		result.append(image);
		result.append(", notification: ");
		result.append(notification);
		result.append(", sound: ");
		result.append(sound);
		result.append(", fullScreenMode: ");
		result.append(fullScreenMode);
		result.append(", about: ");
		result.append(about);
		result.append(", version: ");
		result.append(version);
		result.append(", licencia: ");
		result.append(licencia);
		result.append(')');
		return result.toString();
	}

} //SettingImpl
